package com.zhl.media.app.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.zhl.media.app.model.AdJust;
import com.zhl.media.app.model.Building;
import com.zhl.media.app.model.Elevator;
import com.zhl.media.app.model.MediaPhoto;
import com.zhl.media.app.model.MediaPosition;
import com.zhl.media.app.model.Proj;
import com.zhl.media.app.model.Project;
import com.zhl.media.app.model.Unit;

import com.zhl.media.app.greendao.AdJustDao;
import com.zhl.media.app.greendao.BuildingDao;
import com.zhl.media.app.greendao.ElevatorDao;
import com.zhl.media.app.greendao.MediaPhotoDao;
import com.zhl.media.app.greendao.MediaPositionDao;
import com.zhl.media.app.greendao.ProjDao;
import com.zhl.media.app.greendao.ProjectDao;
import com.zhl.media.app.greendao.UnitDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig adJustDaoConfig;
    private final DaoConfig buildingDaoConfig;
    private final DaoConfig elevatorDaoConfig;
    private final DaoConfig mediaPhotoDaoConfig;
    private final DaoConfig mediaPositionDaoConfig;
    private final DaoConfig projDaoConfig;
    private final DaoConfig projectDaoConfig;
    private final DaoConfig unitDaoConfig;

    private final AdJustDao adJustDao;
    private final BuildingDao buildingDao;
    private final ElevatorDao elevatorDao;
    private final MediaPhotoDao mediaPhotoDao;
    private final MediaPositionDao mediaPositionDao;
    private final ProjDao projDao;
    private final ProjectDao projectDao;
    private final UnitDao unitDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        adJustDaoConfig = daoConfigMap.get(AdJustDao.class).clone();
        adJustDaoConfig.initIdentityScope(type);

        buildingDaoConfig = daoConfigMap.get(BuildingDao.class).clone();
        buildingDaoConfig.initIdentityScope(type);

        elevatorDaoConfig = daoConfigMap.get(ElevatorDao.class).clone();
        elevatorDaoConfig.initIdentityScope(type);

        mediaPhotoDaoConfig = daoConfigMap.get(MediaPhotoDao.class).clone();
        mediaPhotoDaoConfig.initIdentityScope(type);

        mediaPositionDaoConfig = daoConfigMap.get(MediaPositionDao.class).clone();
        mediaPositionDaoConfig.initIdentityScope(type);

        projDaoConfig = daoConfigMap.get(ProjDao.class).clone();
        projDaoConfig.initIdentityScope(type);

        projectDaoConfig = daoConfigMap.get(ProjectDao.class).clone();
        projectDaoConfig.initIdentityScope(type);

        unitDaoConfig = daoConfigMap.get(UnitDao.class).clone();
        unitDaoConfig.initIdentityScope(type);

        adJustDao = new AdJustDao(adJustDaoConfig, this);
        buildingDao = new BuildingDao(buildingDaoConfig, this);
        elevatorDao = new ElevatorDao(elevatorDaoConfig, this);
        mediaPhotoDao = new MediaPhotoDao(mediaPhotoDaoConfig, this);
        mediaPositionDao = new MediaPositionDao(mediaPositionDaoConfig, this);
        projDao = new ProjDao(projDaoConfig, this);
        projectDao = new ProjectDao(projectDaoConfig, this);
        unitDao = new UnitDao(unitDaoConfig, this);

        registerDao(AdJust.class, adJustDao);
        registerDao(Building.class, buildingDao);
        registerDao(Elevator.class, elevatorDao);
        registerDao(MediaPhoto.class, mediaPhotoDao);
        registerDao(MediaPosition.class, mediaPositionDao);
        registerDao(Proj.class, projDao);
        registerDao(Project.class, projectDao);
        registerDao(Unit.class, unitDao);
    }
    
    public void clear() {
        adJustDaoConfig.clearIdentityScope();
        buildingDaoConfig.clearIdentityScope();
        elevatorDaoConfig.clearIdentityScope();
        mediaPhotoDaoConfig.clearIdentityScope();
        mediaPositionDaoConfig.clearIdentityScope();
        projDaoConfig.clearIdentityScope();
        projectDaoConfig.clearIdentityScope();
        unitDaoConfig.clearIdentityScope();
    }

    public AdJustDao getAdJustDao() {
        return adJustDao;
    }

    public BuildingDao getBuildingDao() {
        return buildingDao;
    }

    public ElevatorDao getElevatorDao() {
        return elevatorDao;
    }

    public MediaPhotoDao getMediaPhotoDao() {
        return mediaPhotoDao;
    }

    public MediaPositionDao getMediaPositionDao() {
        return mediaPositionDao;
    }

    public ProjDao getProjDao() {
        return projDao;
    }

    public ProjectDao getProjectDao() {
        return projectDao;
    }

    public UnitDao getUnitDao() {
        return unitDao;
    }

}
